package alipay;

import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;

/**
 * Created with IntelliJ IDEA.
 * User: leep
 * Date: 16-1-6
 * Time: 上午10:08
 * To change this template use File | Settings | File Templates.
 */
public class Alipay {
	public static void main(String[] args) {
		String bizContent = "<success>true</success><biz_content>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsiWEz0oQU5MGlEL8RvR0rH7gqcBtKIlY9PdUO8qy9XWjQA9qZCkxhK3TjJqQWvc5wYvmae+YJYARznOkMyybPrsHBIMIfhe4HvmDo46FVVHSZ73pPwMdwpXwe9tE4dcxAQGq3ytw0TVazvfFW8LMMnGo+G0EtmXteani/GJZ/RwIDAQAB</biz_content>";
		String cusPrivateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAN0g6A9jKRSOqC/D6oijt7j0ykk+08ik5cf0yc3VQ5w7B6cWPeo/sj8mwZeGl3JbsWtkrc4pjDrnyAkWWM12GLRFnJPRCfpxCmu4YYe+EMcR1X/0UHxSB0ecTnFdgxwkIEz7mue2vB10n2gfdOreX4LwDgIojuVwp48TtCS8bOxhAgMBAAECgYATURWUiogDKLcefRHW395jxNaK8XcUtvrvrb2XQoMGec2gVfwQo4HRrHQK5ZIDRmlIRWI9eTmrx6WczZvyTte3dil70ZVB/W08CEYf4Xr/gIQHW0NKqaoDtBvVrtxY5cJhzEz/BhXLGCAJPZSmIpCr2x4oHdaO7+FAF0YvrhZPRQJBAPYrzaLtYAb2rLDOsT1cnJzh1X2tP6ZU6xWVCJvlwl6/jh+DVE86u06IPhXbXctRFq/1q7WHFKJu1uiAQODYO7sCQQDl9SKEGPSe92Ap9As9ooxoLxlvlpXtFg/glGS+10TWzgHE8DYIiVW4qgpZ01ZJnmPaaPNQWGd6umXHNHkyjeCTAkB2ZGS2yhEX6ETvl8iYKVVNAjPqCIuHFGonbBDC4YJUjS3uK/w9SpLQ1yd83Y7DfNE7eRzG5htfb40+LoiFWpmHAkBFNwmSlShcCL1rI0eW36w/V53iVoL9/5v7zu6b+pN/zDYAHwVEgIHKuXOwIcphEkmf3eMOle1fpWcpFIQ+UTH9AkAB/TCUIv2dVQEeQw/3CVjtnpdRSwfvnwNka2O+OWKjPkygQl35+au688sQmTlRpdH7Q6gARsLF2BV22Yi+4EC0";
		String charset = "GBK";
		try {
			AlipaySignature.rsaSign(bizContent, cusPrivateKey, charset);
		} catch (AlipayApiException e) {
			e.printStackTrace();
		}
	}
}
